package com.nbclass.service.impl;

import com.nbclass.domain.User;
import com.nbclass.mapper.UserMapper;
import com.nbclass.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/*
       AUTHOR: Jarvie -> YYDS
  CREATE TIME: 2024/9/14   
*/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    @Transactional
    public void card(String userName) {
        User user = userMapper.queryUserByUserName(userName);
        user.setStatus((Integer.parseInt(user.getStatus())+1)+"");
        userMapper.updateUserCard(user);
    }
    //姓名，班级名等组合分页查询
    @Override
    public List<User> queryAllByNameAndClass(String realname, String cname, String page, String limit) {
        return null;
    }

    @Override
    public List<User> queryAll() {
        String rname=new String();
        rname="学生";

        return userMapper.queryAll(rname);
    }
}
